package com.project.bean;

import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.List;

/**
 * 项目实体类
 */
public class ProgramBean {
    /**项目id*/
    private int id;
    /**项目名称*/
    private String name;
    /**客户名称*/
    private String customerName;
    /**项目资金*/
    private int money;
    /**项目开始日期*/
    private LocalDate startDate = LocalDate.now();
    /**项目交期*/
    private LocalDate finishDate;
    /**项目状态*/
    private String status = "开发中";
    /**项目参与人数*/
    private int personNum;
    /**项目剩余天数*/
    private String remainDays;
    /**员工的项目进度列表*/
    private List<ProcessBean> list;

    public ProgramBean() {
    }

    public ProgramBean(String name, String customerName, int money, LocalDate finishDate) {
        this.name = name;
        this.customerName = customerName;
        this.money = money;
        this.finishDate = finishDate;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public LocalDate getStartDate() {
        return startDate;
    }

    public void setStartDate(LocalDate startDate) {
        this.startDate = startDate;
    }

    public LocalDate getFinishDate() {
        return finishDate;
    }

    public void setFinishDate(LocalDate finishDate) {
        this.finishDate = finishDate;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public int getPersonNum() {
        return personNum;
    }

    public void setPersonNum(int personNum) {
        this.personNum = personNum;
    }

    public String getRemainDays() {
        if ("已交付".equals(this.status)) {
            return "交付使用";
        }
        return ChronoUnit.DAYS.between(LocalDate.now(), finishDate) + "";
    }

    public List<ProcessBean> getList() {
        return list;
    }

    public void setList(List<ProcessBean> list) {
        this.list = list;
    }

    @Override
    public String toString() {
        return "ProgramBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", customerName='" + customerName + '\'' +
                ", money=" + money +
                ", startDate=" + startDate +
                ", finishDate=" + finishDate +
                ", status='" + status + '\'' +
                ", personNum=" + personNum +
                ", remainDays='" + remainDays + '\'' +
                ", list=" + list +
                "}\n";
    }
}
